package com.fzkj.shejimoshi.adapter;

import com.fzkj.shejimoshi.adapter.advancemedia.AbstractAdvanceMediaPlayer;
import com.fzkj.shejimoshi.adapter.media.MediaPlayer;

/**
 * @DESCRIPTION: TODO
 * @AUTHOR: AnotherOne
 * @DATE: 2021/8/12 16:26
 */
public class MediaAdapter implements MediaPlayer {

    AbstractAdvanceMediaPlayer mediaPlayer;

    public MediaAdapter(AbstractAdvanceMediaPlayer mediaPlayer){
        this.mediaPlayer = mediaPlayer;
    }

    @Override
    public void play(AudioType audioType, String fileName) {
        if (audioType == AudioType.MP4){
            mediaPlayer.playMp4(fileName);
        }
        if (audioType == AudioType.VLC){
            mediaPlayer.playVlc(fileName);
        }
    }
}
